/*  
 *  Copyright 2006 Paul Jack.
 *
 *  This file is part of the Dex compiler suite. 
 *  
 *  Dex is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License as published by the
 *  Free Software Foundation; either version 2 of the License, or (at your
 *  option) any later version.
 *  
 *  Dex is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
 *  Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 */
package dex.compiler.model.statement;


import dex.compiler.model.base.Place;


/**
 * A comment, such as <code>// You are not expected to understand this</code>.
 * Unlike many languages, in Dex comments are significant, because macros may
 * examine them.
 */
public class Comment extends Statement {
	
	
	/**
	 * The message of the comment.
	 */
	private String message;
	

	/**
	 * Returns the message of this comment.
	 * 
	 * @return the message of this comment.
	 */
	public String getMessage() {
		return message;
	}

	
	/**
	 * Constructs a new comment.
	 * 
	 * @param place  the place where the comment originated. 
	 * @param message  the message of the comment
	 */
	public Comment(Place place, String message) {
		super(place);
		if (message == null) {
			throw new IllegalArgumentException();
		}
		this.message = message;
	}

	@Override
	public String toString() {
		return "/*" + message + "*/";
	}


	@Override
	public boolean terminates() {
		return false;
	}

}
